//
//  titleButton.swift
//  swiftWeiBoDemo
//
//  Created by zzw on 16/3/25.
//  Copyright © 2016年 zzw. All rights reserved.
//

import UIKit

class titleButton: UIButton {

    /*
    // Only override drawRect: if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func drawRect(rect: CGRect) {
        // Drawing code
    }
    */
  override  init(frame: CGRect) {
    super.init(frame: frame)
    setTitleColor(UIColor.darkGrayColor(), forState: UIControlState.Normal)
    setImage(UIImage(named: "navigationbar_arrow_up"), forState: UIControlState.Normal)
    setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Selected)
    self.sizeToFit()
    }
  required init?(coder aDecoder: NSCoder) {
      fatalError("init(coder:) has not been implemented")
  }
    override func layoutSubviews() {
        super.layoutSubviews()
        titleLabel?.frame.origin.x = 0;
        imageView?.frame.origin.x = titleLabel!.frame.size.width
    
    }

}
